import { http } from "@/utils/request";
import type {
  listQueryType,
  PageProjectTypeResultVO,
  createProjectParamsType,
  projectTypeVo,
} from "@/interface/pm/globalProjectType.ts";

export const getProjectTypeList = (
  data: listQueryType,
): Promise<PageProjectTypeResultVO> => {
  return http.post("/projectType/list", data);
};

export const createProjectType = (
  data: createProjectParamsType,
): Promise<createProjectParamsType> => {
  return http.post("/projectType/create", data);
};

export const updateProjectType = (
  data: createProjectParamsType,
): Promise<null> => {
  return http.put("/projectType/edit", data);
};

export const deleteProjectType = (id: string): Promise<null> => {
  return http.delete(`/projectType/${id}`);
};

export const deleteProjectTypeBatch = (ids: string[]): Promise<null> => {
  return http.post(`/projectType/deleteBatch`, ids);
};

export const detailProjectType = (id: string): Promise<projectTypeVo> => {
  return http.get(`/projectType/${id}`);
};
